package com.wkhyapp.lm.contract;

import com.wkhyapp.lm.base.BasePresenter;
import com.wkhyapp.lm.http.ApiCallback;
import com.wkhyapp.lm.http.net.BaseRequest;
import com.wkhyapp.lm.http.net.CreateVirtualRequest;
import com.wkhyapp.lm.http.net.SuperResponse;
import com.wkhyapp.lm.http.vo.CCategory;

/**
 * Created by fang on 2022/1/17.
 */

public class CategoryPresenter extends BasePresenter<CategoryView> {

    public CategoryPresenter(CategoryView categoryView) {
        super(categoryView);
    }



    public void  getData(){
        BaseRequest request = new BaseRequest();
        addSubscription(apiStores.category(request),new ApiCallback<SuperResponse<CCategory>>() {
            @Override
            public void onSuccess(SuperResponse<CCategory> response) {
                mvpView.setData(response.getItems());
            }
            @Override
            public void onFailure(String msg) {
                mvpView.dismissLoad();
            }

            @Override
            public void onFinish() {
            }
        });
    }
}
